From 50ff659c3a79d724267e3ec333cb1b11e78a81ec Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 24 Mar 2026 10:37:36 +1000 Subject: [PATCH] tools/toolbox: Ignore missing config files The config file is created by our own create-toolbox.sh script which sets the DEFAULT_TOOLBOX name. But for toolboxes created directly that file doesn't exist, so let's skip over that (and thus require the toolbox name to be given on the commandline or via an env var). Part-of: --- tools/toolbox/meson-build.sh | 4 +++- tools/toolbox/meson-test.sh | 4 +++- tools/toolbox/run-gnome-shell.sh | 4 +++- tools/toolbox/toolbox-sysext-install.sh | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/toolbox/meson-build.sh b/tools/toolbox/meson-build.sh index 56eaf3ed3..82f388cdb 100755 --- a/tools/toolbox/meson-build.sh +++ b/tools/toolbox/meson-build.sh @@ -74,7 +74,9 @@ dist_command() { } # load defaults -. $CONFIG_FILE +if [[ -e "$CONFIG_FILE" ]]; then + . $CONFIG_FILE +fi TOOLBOX=$DEFAULT_TOOLBOX TEMP=$(getopt \ diff --git a/tools/toolbox/meson-test.sh b/tools/toolbox/meson-test.sh index 5ebc7072f..9f28cb684 100755 --- a/tools/toolbox/meson-test.sh +++ b/tools/toolbox/meson-test.sh @@ -47,7 +47,9 @@ find_toplevel() { } # load defaults -. $CONFIG_FILE +if [[ -e "$CONFIG_FILE" ]]; then + . $CONFIG_FILE +fi TOOLBOX=$DEFAULT_TOOLBOX TEMP=$(getopt \ diff --git a/tools/toolbox/run-gnome-shell.sh b/tools/toolbox/run-gnome-shell.sh index 13ac238de..2ae5b25a1 100755 --- a/tools/toolbox/run-gnome-shell.sh +++ b/tools/toolbox/run-gnome-shell.sh @@ -58,7 +58,9 @@ has_nested() { } # load defaults -. $CONFIG_FILE +if [[ -e "$CONFIG_FILE" ]]; then + . $CONFIG_FILE +fi TOOLBOX=$DEFAULT_TOOLBOX SHELL_ENV=(XDG_CURRENT_DESKTOP=GNOME) diff --git a/tools/toolbox/toolbox-sysext-install.sh b/tools/toolbox/toolbox-sysext-install.sh index 6310fb00e..d68af8641 100755 --- a/tools/toolbox/toolbox-sysext-install.sh +++ b/tools/toolbox/toolbox-sysext-install.sh @@ -94,7 +94,9 @@ relabel_command() { } # load defaults -. $CONFIG_FILE +if [[ -e "$CONFIG_FILE" ]]; then + . $CONFIG_FILE +fi TOOLBOX=$DEFAULT_TOOLBOX TEMP=$(getopt \ -- 2.39.5